
package com.aceitunaproject.server.materialgoods;

import java.util.Map;

import com.aceitunaproject.server.ServerConfiguration;



public class MaterialGoodManagerImpl implements MaterialGoodManager {

	private Map<String, MaterialGood> allMaterialGoods;
	private MaterialGoodLoader MaterialGoodLoader;
	
	@Override
	public Map<String, MaterialGood> getAllMaterialGoods() {
		
		if(allMaterialGoods == null)
		{
			allMaterialGoods = getMaterialGoodLoader().getMaterialGoods();
		}
		return allMaterialGoods;
	}

	@Override
	public MaterialGoodLoader getMaterialGoodLoader() {
		if(MaterialGoodLoader == null)
		{
			MaterialGoodLoader = ServerConfiguration.getMaterialGoodLoader();
		}
		return MaterialGoodLoader;
	}

	@Override
	public void setMaterialGoodLoader(
			MaterialGoodLoader MaterialGoodLoader) {
		this.MaterialGoodLoader = MaterialGoodLoader;
		
	}

}
